package com.egg.basic.fegin;

import com.egg.basic.enums.sms.SmsTypeEnum;
import com.egg.basic.fegin.fallback.BasicSmsFeignClientFallback;
import com.egg.common.core.model.controller.FeignController;
import com.egg.common.core.model.response.ResponseData;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(
        name = "basic"
        , url = "${api.feign.url.basic:}"
        , path = FeignController.PATH_PREFIX
        , fallbackFactory = BasicSmsFeignClientFallback.class
)
public interface BasicSmsFeignClient {


    @GetMapping("/sms/code/send")
    ResponseData<String> sendSms(
            @ApiParam(value = "手机号码", required = true) @RequestParam(value = "phone") String phone
            , @ApiParam(value = "业务类型", required = true) @RequestParam(value = "smsType") SmsTypeEnum smsType
    );

    @GetMapping("/sms/code/verify")
    ResponseData<Boolean> verifySms(
            @ApiParam(value = "手机号码", required = true) @RequestParam(value = "phone") String phone
            , @ApiParam(value = "业务类型", required = true) @RequestParam(value = "smsType") SmsTypeEnum smsType
            , @ApiParam(value = "验证码", required = true) @RequestParam(value = "verifyCode") String verifyCode
    );


}
